/**
 * Created by yangfan on 2016/10/10.
 */
define(['config/appregister'],function(app) {

    app.factory("DetailFilter",function(){

        //接收一个国际化资料细分 返回专业  内容 项目模式 三种分类
       return {
           getDetail:function(input){
               if(!input){
                   return
               }
               var response = {
                   major:[],
                   content:[],
                   projectPattern:[],
                   dataNew:[]
               };
               for(var i = 0 ; i < input.length; i ++){
                   if(input[i].dcType == 10){
                       response.dataNew.push(input[i]);
                   }
                   if(input[i].dcType % 3==1 && input[i].dcType != 10){
                       response.major.push(input[i]);
                   }
                   if(input[i].dcType % 3==2){
                       response.content.push(input[i]);
                   }
                   if(input[i].dcType % 3==0){
                       response.projectPattern.push(input[i]);
                   }
               }

               return response;
           }
       }
    });
    app.filter("bracket",function(){
        return function (input) {
            if(typeof input == "undefined" ||typeof input =="null")return;
            return "("+input + ")"
        }
    });

});